using System;
using System.Globalization;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Xml;
using System.Reflection;
using Services;
using Utilities.Menu.UIElements;
using BowMaster.Resources;
using Utilities;

namespace BowMaster.SceneElements
{
    public enum Faction { Player, Enemy }
    public enum Direction { Left, Right }
    public class BowMan
    {
        Texture2D bowman, bow;
        Rectangle bowmanRect, bowRect;
        public float bow_rotation;
        public Vector2 arrow_start;
        Vector2 bow_rot_origin;
        Faction faction;
        Direction direction;
        float life;
        float max_life;
        public BowMan(Texture2D bowman, Texture2D bow, int x, int y, float life)
        {
            this.bowman = bowman;
            this.bow = bow;
            this.bow_rotation = 0;
            bow_rot_origin = new Vector2(0, 73);
            bowmanRect = new Rectangle(x, y, 87, 112);
            bowRect = new Rectangle(36 + x, y + 35, 41, 72);
            bow_rotation = 0;
            arrow_start = new Vector2(x + 40, y + 30);
            direction = Direction.Right;
            faction = Faction.Player;
            this.max_life = this.life = life;
        }
        public void Draw(SpriteBatch spriteBatch, Matrix view, Matrix projection)
        {
            spriteBatch.DrawTexture(bow, bowRect, Color.White, bow_rotation, bow_rot_origin, view, projection);
            spriteBatch.DrawTexture(bowman, bowmanRect, Color.White, view, projection);
        }
    }
}
